// var pathname = window.location.pathname;
classErrContent = $('#err-content');
classErrCaptcha = $('#err-captcha');

classErrContent.hide();
classErrCaptcha.hide();
function getSend(url, content){
	if($('#content_send').val() == '' || $('#verifyCode').val()== ''){
		if($('#content_send').val() == ''){
			$('#div-contentck').addClass('form-group has-error');
			classErrContent.show();
			classErrContent.addClass("alert alert-danger");
        	classErrContent.html('<span class="glyphicon glyphicon-exclamation-sign"></span> Bạn chưa nhập nội dung, hãy thử lại !');
        	$('#sendButton').attr('disabled','disabled');
        	setTimeout(function(){
        		classErrContent.hide("fast");
        		$('#div-contentck').removeClass('form-group has-error');
        		$('#sendButton').removeAttr('disabled','disabled');
        	}, 3000);
		}
		if($('#verifyCode').val() == ''){
			//$('#div-captchack #verifyCode').css('border', '1px solid red');
			classErrCaptcha.show();
			classErrCaptcha.addClass("alert alert-danger");
        	classErrCaptcha.html('<span class="glyphicon glyphicon-exclamation-sign"></span> Bạn chưa nhập captcha, hãy thử lại !');
        	$('#sendButton').attr('disabled','disabled');
        	setTimeout(function(){
        		classErrCaptcha.hide("fast");
        		$('#sendButton').removeAttr('disabled','disabled');
        	}, 3000);
		}
		return false;
		//location.reload();
	}
	else{
		$.ajax({
		  	type: "POST",
		  	url: url,
		  	data: {'content': content},
		  	beforeSend: function() {
				$('#overclay').show();
		  	},
		  	success: function(data){
			  	$('#overclay').hide();
			  	//location.reload();
		  	}
		});
	}
}
	